package com.xpec.c4.h5net;

import com.ms.game.slot.base.message.SlotBasicGameMessageRequest;
import com.ms.game.slot.base.message.SlotGameDoSeatVerifyRequest;
import com.ms.service.module.zone.message.CPlayerLoginZoneRequest;
import com.ms.service.module.zone.message.CPlayerSwitchZoneRequest;
import com.xpec.c4.game.utility.GUID;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.group.transportlayer.GroupMessage;
import com.xpec.c4.service.message.MessageAction;
import com.xpec.c4.service.module.ConsistentGroupName;
import com.xpec.c4.service.module.common.PlayerCommonInfoManager;

public class H5GatewayDoSeat {
	
	public static void sendSwitchZoneMessage(CPlayerSwitchZoneRequest request, GUID sessionId) {
		GroupMessage msg = new GroupMessage();
		msg.setMessageType(MessageTypes.C_PLAYER_SWITCH_ZONE_REQUEST);
		msg.setDestModuleID(ConsistentGroupName.lookUpGameLobbyModule(PlayerCommonInfoManager.getInstance().getPlayerGuidBySession(sessionId), false));
		msg.setMessageContent(request);
		msg.setSessionID(sessionId);
		MessageAction.sendMessage(msg);
	}
	
	public static void sendLoginZoneMessage(CPlayerLoginZoneRequest request, GUID sessionId, String moduleId) {
		GroupMessage msg = new GroupMessage();
		msg.setMessageType(MessageTypes.C_PLAYER_LOGIN_ZONE_REQUEST);
		msg.setDestModuleID(moduleId);
		msg.setMessageContent(request);
		msg.setSessionID(sessionId);
		MessageAction.sendMessage(msg);
	}

	public static void sendDoSeatVerify(SlotGameDoSeatVerifyRequest verifyRequest, GUID sessionId, String moduleId) {
		GroupMessage msg = new GroupMessage();
		msg.setMessageType(MessageTypes.C_SLOT_DOSEAT_VERIFY);
		msg.setDestModuleID(moduleId);
		msg.setMessageContent(verifyRequest);
		msg.setSessionID(sessionId);
		MessageAction.sendMessage(msg);
	}

	public static void sendDoSeatVerify(SlotBasicGameMessageRequest verifyRequest, GUID sessionId, String moduleId) {
		GroupMessage msg = new GroupMessage();

		msg.setDestModuleID(moduleId);
		msg.setMessageContent(verifyRequest);
		msg.setSessionID(sessionId);
		MessageAction.sendMessage(msg);
	}
}